﻿using Hotel.DAL;
using Hotel.Model.admin;

namespace Hotel.BLL
{
    public class adminBLL
    {

        public adminBLL(adminDAL adminDAL)
        {
            AdminDAL = adminDAL;
        }

        public adminDAL AdminDAL { get; }





        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public adminModel Login(string UserName)
        {
            return AdminDAL.Login(UserName);
        }






        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="adminModel"></param>
        /// <returns></returns>
        public int adminAdd(adminModel adminModel)
        {
            return AdminDAL.adminAdd(adminModel);
        }











        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="count">总条数</param>
        /// <param name="page">总页数</param>
        /// <param name="UserName"></param>
        /// <param name="index">当前页</param>
        /// <param name="size">每页几条</param>
        /// <returns></returns>
        public List<adminModel> adminList(out int count, out int page, string? UserName = "", int index = 1, int size = 3)
        {

            return AdminDAL.adminList(out count, out page, UserName, index, size);
        }







        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int adminDel(int id)
        {

            return AdminDAL.adminDel(id);



        }



        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public adminModel adminAll(int id)
        {

            return AdminDAL.adminAll(id);


        }




        /// <summary>
        /// 修改·
        /// </summary>
        /// <param name="adminModel"></param>
        /// <returns></returns>
        public int adminUpd(adminModel adminModel)
        {


            return AdminDAL.adminUpd(adminModel);
        }



















    }
}